Skip to content

Instantly share code, notes, and snippets.

@justinmoon
Last active October 13, 2022 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinmoon/6dde2bc2211ffd1021247994ec64ab9b to your computer and use it in GitHub Desktop.
Save justinmoon/6dde2bc2211ffd1021247994ec64ab9b to your computer and use it in GitHub Desktop.

setting up developer environment

Instructions.

Our developer environment is amazing, but it downloads a few gigabytes of data to get set up

fedimint-cli

# pull docker image
docker pull fedimint/fedimint-cli:master

# alias fedimint-cli to docker version
alias fedimint-cli="docker run -v $PWD/demo:/var/fedimint fedimint/fedimint-cli:master fedimint-cli --workdir /var/fedimint"

# join federation at https://testfed.xyz
fedimint-cli join-federation '{"members":[[0,"ws://188.166.55.8:17241/"]]}'

# look at `demo/client.json`

# see wallet balances
fedimint-cli info

# create invoice (decode, pay in faucet)
fedimint-cli ln-invoice <amount> <description>

# pay the invoice on https://testfed.xyz

# sweep funds
fedimint-cli wait-invoice <invoice>
fedimint-cli fetch

# see updated balances
fedimint-cli info

# produce ecash
fedimint-cli spend <amount> 

# see updated balances
fedimint-cli info

# sweep ecash back to wallet
fedimint-cli reissue <ecash>
fedimint-cli fetch

# see updated balances
fedimint-cli info

# play with spending different amounts to understand coin selection

# get invoice from testfed.xyz and pay it
fedimint-cli ln-pay <invoice>

What is a note?

How does lightning integration work?

What's backing all this?

Wallet Module

Other modules

Module ideas

  • DLC execution
  • Federated statechain

Setup a federation

Run 2 servers

docker run -v $PWD/demo:/var/fedimint fedimint/fedimintd:master fedimintd /var/fedimint/mint-1.json /var/fedimint/mint-1.db 10000

docker run -v $PWD/demo:/var/fedimint fedimint/fedimintd:master fedimintd /var/fedimint/mint-2.json /var/fedimint/mint-2.db 10001

Use this for btc rpc bitcoin:bitcoin@188.166.55.8:18443

After setup, take a look at /demo

Note: this is a hack. we've merged distributed key generation. on saturday we'll probably try to hack these together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment