[WIP] E2E Relay Own Your Own Service

pocketd keys add olshansky_anvil_test_service_owner
pocketd keys add olshansky_anvil_test_app
pocketd keys add olshansky_anvil_test_gateway
pocketd keys add olshansky_anvil_test_supplier

Export addresses:

export OLSHANSKY_ANVIL_TEST_SERVICE_OWNER_ADDR=$(pocketd keys show olshansky_anvil_test_service_owner -a)
export OLSHANSKY_ANVIL_TEST_APP_ADDR=$(pocketd keys show olshansky_anvil_test_app -a)
export OLSHANSKY_ANVIL_TEST_GATEWAY_ADDR=$(pocketd keys show olshansky_anvil_test_gateway -a)
export OLSHANSKY_ANVIL_TEST_SUPPLIER_ADDR=$(pocketd keys show olshansky_anvil_test_supplier -a)

Fund accounts:

pocketd tx bank send $FUNDING_ADDR $OLSHANSKY_ANVIL_TEST_SERVICE_OWNER_ADDR 100000000upokt --network=beta --fees=100upokt --unordered --timeout-duration=5s --yes
pocketd tx bank send $FUNDING_ADDR $OLSHANSKY_ANVIL_TEST_APP_ADDR 100000000upokt --network=beta --fees=100upokt --unordered --timeout-duration=5s --yes
pocketd tx bank send $FUNDING_ADDR $OLSHANSKY_ANVIL_TEST_GATEWAY_ADDR 100000000upokt --network=beta --fees=100upokt --unordered --timeout-duration=5s --yes
pocketd tx bank send $FUNDING_ADDR $OLSHANSKY_ANVIL_TEST_SUPPLIER_ADDR 100000000upokt --network=beta --fees=100upokt --unordered --timeout-duration=5s --yes

Export private keys:

pocketd keys export olshansky_anvil_test_service_owner --unsafe --unarmored-hex --yes
pocketd keys export olshansky_anvil_test_app --unsafe --unarmored-hex --yes
pocketd keys export olshansky_anvil_test_gateway --unsafe --unarmored-hex --yes
pocketd keys export olshansky_anvil_test_supplier --unsafe --unarmored-hex --yes

Import Accounts to Vultr Instance

SSH into your Vultr instance and import the accounts.

Replace <hex> with the actual hex private keys exported in the previous step:

(Direct link to Import Accounts to Vultr Instance: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#import-accounts-to-vultr-instance)


Service Setup

(Direct link to Service Setup: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#service-setup)

Create Service

Create a new service on-chain for your Anvil test environment:

The value 7 represents compute units per relay for this service. Adjust based on your service's computational cost.

(Direct link to Create Service: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#create-service)


Create Application

Create the application configuration:

Stake the application:

Verify the application:

(Direct link to Create Application: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#create-application)


Create Supplier

Create the supplier configuration:

Stake the supplier:

Verify the supplier:

(Direct link to Create Supplier: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#create-supplier)


Anvil Node Setup

(Direct link to Anvil Node Setup: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#anvil-node-setup)

Install Foundry

(Direct link to Install Foundry: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#install-foundry)


Start Anvil

Create a startup script:

Start Anvil:

Verify Anvil is running:

Test the connection:

(Direct link to Start Anvil: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#start-anvil)


RelayMiner Configuration

(Direct link to RelayMiner Configuration: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#relayminer-configuration)

Create RelayMiner Config

(Direct link to Create RelayMiner Config: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#create-relayminer-config)


Start RelayMiner

Configure firewall to allow external connections on port 8545:

Start the RelayMiner:

Consider running the RelayMiner in a tmux or screen session, or as a systemd service for production use.

(Direct link to Start RelayMiner: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#start-relayminer)


Testing

(Direct link to Testing: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#testing)

Send a Test Relay

In a separate shell, send a test relay:

(Direct link to Send a Test Relay: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#send-a-test-relay)


Verify Claims

Check if your RelayMiner created any claims:

(Direct link to Verify Claims: https://dev.poktroll.com/operate/cheat_sheets/relays_to_your_own_service_cheatsheet#verify-claims)


Next Steps

Your RelayMiner should now be running and processing relays.

Monitoring and troubleshooting:

  • Monitor RelayMiner logs for incoming relay requests

  • Check Anvil logs at anvil.log for backend activity

  • Query claims periodically to verify relay processing

  • Use pocketd query proof list-claims --network=beta to see all recent claims

Common issues:

  • Port conflicts: Ensure port 8545 is not already in use (netstat -tlnp | grep 8545)

  • Firewall blocking: Verify UFW allows port 8545 (sudo ufw status)

  • Session not started: Relays only work during active sessions; check session timing with pocketd query session get-session

Last updated

Was this helpful?