-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sapphire-localnet: expose internal.sock #423
Comments
Some reading https://docs.oasis.io/core/oasis-node/rpc I think we use https://www.npmjs.com/package/envoy-node in production. |
The following works, but it's not pretty, acrobatics with docker's permissions... mkdir serverdir
docker run -it -p8545:8545 -p8546:8546 -v /home/user/serverdir:/serverdir ghcr.io/oasisprotocol/sapphire-dev
# wait for sapphire-dev to spin up
# fix permissions
sudo chmod a+x serverdir/node/net-runner
sudo chmod a+x serverdir/node/net-runner/network
sudo chmod a+x serverdir/node/net-runner/network/client-0
sudo chmod a+rwx serverdir/node/net-runner/network/client-0/internal.sock
# now we can use Oasis CLI on internal.sock, for example
oasis net add-local docker unix:/home/user/serverdir/node/net-runner/network/client-0/internal.sock
oasis pt add docker sapphire 8000000000000000000000000000000000000000000000000000000000000000
oasis acc show test:cory --network docker Another useful thing is that the |
Another way of doing it would be just adding the oasis-cli to the container, and having a shell script which either starts the node or executes oasis-cli within the current node? That would avoid a lot of bind mounting weirdness and permissions, although wouldn't let you do development of the CLI against a sapphire-dev node. Is there any reason we can't just connect over TCP? Then you can expose it via |
➕ |
I'm using bind mounts to expose the serverdir in
This has been working well for me for a few months. |
Adding the requirement that this should ideally work for Mac as well. |
This will allow Go client and Oasis CLI can connect from outside docker.
One option would be to do a bind-mount to expose the
client-0
directory:Another cleaner option would be to expose over TCP.
Or, may be able to link two containers together and directly expose the socket from one to another?
The text was updated successfully, but these errors were encountered: