Skip to content
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

feat(tapd): Add support for Taproot Assets Protocol nodes #641

Merged
merged 52 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1eeecdd
feat(taro): add tarod implementation
jamaljsr Dec 26, 2022
009cde9
feat(taro): connect to tarod nodes via gRPC
jamaljsr Dec 27, 2022
67945b3
feat(taro): display taro assets in InfoTab
jamaljsr Dec 27, 2022
2b64866
feat(taro): add Connect and Actions tabs
jamaljsr Dec 27, 2022
534d704
feat(taro): display asset info and utxos
jamaljsr Dec 28, 2022
ad4ff4c
feat(taro): update docker ports when the network starts
jamaljsr Dec 29, 2022
0fe6b52
feat(taro): show an error if there are no LND nodes available running…
jamaljsr Dec 29, 2022
6ada7e9
feat(min-taro-asset): squashed commits
Jan 13, 2023
4b83235
fix(mint-taro-asset): double check review
Jan 13, 2023
e8dc31b
fix(reivew): hit majority of notes
Jan 14, 2023
dffbfb2
fix(review 4): notes
Jan 21, 2023
b1ae861
fix(new-address-modal): squish commits
Jan 24, 2023
cd91f21
fix(new-address-modal): tidy up modal
Jan 24, 2023
a21c04a
fix(ux-review): feedback on new-address-modal
Jan 27, 2023
939c1b5
fix(workflow): feedback
Jan 29, 2023
5bd334b
fix(modal): reviewed code
Jan 29, 2023
dabcc8e
fix(review): fixed up review notes
Jan 31, 2023
53f8082
fix(new-address-modal): pruned arg for removed parameter
Jan 31, 2023
87ffb59
fix(TaroDataSelect): optimizations
Jan 31, 2023
05c526f
fix(TaroDataSelect): added missing type
Jan 31, 2023
a34b3aa
fix(review): second review notes
Feb 1, 2023
5d0be0e
fix(linting): removed linting errors
Feb 2, 2023
4eaedd3
test: add unit tests for all the new Taro features
jamaljsr Feb 7, 2023
ecd0f3f
fix(network-card): added taro nodes stat to network card
Feb 8, 2023
7030507
fix(network-card): review notes
Feb 9, 2023
27e98ab
feat(taro-lnd-link-details): info tab for taro-lnd link
Feb 8, 2023
126dc2d
fix(taro-backend-link): review notes
Feb 9, 2023
1b068d6
fix(caseing): tarobackend
Feb 11, 2023
62b4c92
fix(squash commit): send asset modal
Feb 7, 2023
4c7bab5
fix(test): mint asset modal test
Feb 7, 2023
fb088b2
fix(missing type): fixed missed refactor
Feb 7, 2023
7c14a1b
fix(send-asset-modal): review notes
Feb 9, 2023
80ba9f5
fix(refactor): test
Feb 9, 2023
364a956
fix(tests): refactor for readability
Feb 9, 2023
494119e
fix(review notes): various
Feb 11, 2023
63c77a2
fix(button placement): missed review note
Feb 11, 2023
71d050b
fix(coverage): improved tests and code
Feb 12, 2023
c0b974f
fix(typing): stronger typing to avoid conditional
Feb 12, 2023
1886f18
fix(linting): added --max-warnings 0
Feb 12, 2023
a1a20c1
fix(taro): fix mint asset metadata (#672)
amovfx Feb 15, 2023
92daf0c
feat(taro): allow updating the LND backend of Taro nodes
amovfx Feb 25, 2023
3dbbb98
fix(taro): show only nodes with assets in asset dropdown
amovfx Feb 26, 2023
5949be2
fix(taro): improve send asset modal (#684)
amovfx Feb 26, 2023
cf747f2
fix(taro): general fixes for taro integration (#685)
amovfx Mar 18, 2023
4955eb3
feat(taro): update version to v0.2.0-alpha
jamaljsr May 9, 2023
908ee5c
feat(taro): update types from @hodlone/taro-api
jamaljsr May 10, 2023
6fd1c32
feat(taro): update mintAsset modal
jamaljsr May 10, 2023
84d2320
feat(taro): update NewAddress modal to sync universe
jamaljsr May 10, 2023
0e8b1c0
feat(taro): remove genesisBootstrap and metadata
jamaljsr May 11, 2023
1b0a36a
test(taro): add and update unit tests
jamaljsr May 11, 2023
822bfc7
refactor: rename Taro to Taproot Assets Protocol
jamaljsr May 15, 2023
55fbd38
ci: temporarily use taro-api package from jamaljsr github
jamaljsr May 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ jobs:
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- uses: actions/checkout@v1
with:
repository: jamaljsr/taro-api
ref: v2-updates
path: taro-api

- uses: actions/checkout@v1
with:
path: polar

- name: setup nodejs
uses: actions/setup-node@v1
Expand All @@ -47,6 +55,13 @@ jobs:
- name: install yarn
run: npm install -g yarn

- name: setup taro-api
working-directory: ../taro-api
run: |
npm install
npm run build
yarn link

- name: get yarn cache dir
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand All @@ -62,6 +77,9 @@ jobs:
- name: install dependencies
run: yarn

- name: link taro-api
run: yarn link @hodlone/taro-api

- name: lint code
run: yarn lint

Expand Down
6 changes: 2 additions & 4 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"*.{ts,tsx}": [
"eslint --ext .ts,.tsx --fix",
"eslint --ext .ts,.tsx --fix --max-warnings 0",
"prettier --single-quote --write"
],
"{.{babelrc,eslintrc,prettierrc,stylelintrc}}": [
"prettier --parser json --write"
],
"{.{babelrc,eslintrc,prettierrc,stylelintrc}}": ["prettier --parser json --write"],
"*.{yml,md}": ["prettier --single-quote --write"]
}
27 changes: 27 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,33 @@ $ docker buildx build --platform linux/amd64,linux/arm64 --build-arg ECLAIR_VERS

Replace `<version>` with the desired Eclair version (ex: `0.3.3`).

**Push to Docker Hub**

```sh
$ docker push polarlightning/eclair:<version>
```

## Taproot Assets Protocol

### Tags

- `0.2.0-alpha` ([tap/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/tap/Dockerfile))

**Building the image**

```sh
$ cd tapd
$ docker buildx build --platform linux/amd64,linux/arm64 --build-arg TAPD_VERSION=<version> -t polarlightning/tapd:<version> --push .
```

Replace `<version>` with the desired Tap version (ex: `0.2.0-alpha`).

**Push to Docker Hub**

```sh
$ docker push polarlightning/tapd:<version>
```

# Out-of-Band Image Updates

> Note: These steps can only be performed by developers with commit access to this GitHub repo and push access to the Docker Hub repo
Expand Down
9 changes: 8 additions & 1 deletion docker/nodes.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 47,
"version": 48,
"images": {
"LND": {
"latest": "0.16.2-beta",
Expand Down Expand Up @@ -35,6 +35,13 @@
"btcd": {
"latest": "",
"versions": []
},
"tapd": {
"latest": "0.2.0-alpha",
"versions": ["0.2.0-alpha"],
"compatibility": {
"0.2.0-alpha": "0.16.0-beta"
}
}
}
}
35 changes: 35 additions & 0 deletions docker/tapd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# IMAGE FOR BUILDING
FROM golang:1.19.2 as builder

ARG TAPD_VERSION

WORKDIR /app

RUN git clone https://github.com/lightninglabs/taproot-assets.git .

ENV CGO_ENABLED=0

RUN make install

# FINAL IMAGE
FROM debian:buster-slim as final

RUN apt-get update -y \
&& apt-get install -y curl gosu wait-for-it \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY --from=builder /go/bin/tapd /bin/
COPY --from=builder /go/bin/tapcli /bin/

COPY docker-entrypoint.sh /entrypoint.sh
RUN chmod a+x /entrypoint.sh

VOLUME ["/home/tap/.tapd"]

EXPOSE 10029
EXPOSE 8089

ENTRYPOINT ["/entrypoint.sh"]

CMD ["tapd"]
29 changes: 29 additions & 0 deletions docker/tapd/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
set -e

# containers on linux share file permissions with hosts.
# assigning the same uid/gid from the host user
# ensures that the files can be read/write from both sides
if ! id tap > /dev/null 2>&1; then
USERID=${USERID:-1000}
GROUPID=${GROUPID:-1000}

echo "adding user tap ($USERID:$GROUPID)"
groupadd -f -g $GROUPID tap
useradd -r -u $USERID -g $GROUPID tap
chown -R $USERID:$GROUPID /home/tap
fi

if [ $(echo "$1" | cut -c1) = "-" ]; then
echo "$0: assuming arguments for tapd"

set -- tapd "$@"
fi

if [ "$1" = "tapd" ] || [ "$1" = "tapcli" ]; then
echo "Running as tap user: $@"
exec gosu tap "$@"
fi

echo "$@"
exec "$@"
6 changes: 4 additions & 2 deletions electron/appIpcListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { join } from 'path';
import { ipcChannels } from '../src/shared';
import { APP_ROOT, BASE_URL } from './constants';
import { httpProxy } from './httpProxy';
import { clearProxyCache } from './lnd/lndProxyServer';
import { clearLndProxyCache } from './lnd/lndProxyServer';
import { clearTapdProxyCache } from './tapd/tapdProxyServer';
import { unzip, zip } from './utils/zip';

const openWindow = async (args: { url: string }): Promise<boolean> => {
Expand Down Expand Up @@ -49,7 +50,8 @@ const openWindow = async (args: { url: string }): Promise<boolean> => {
* consistent with all the other listeners
*/
const clearCache = (): Promise<{ success: boolean }> => {
clearProxyCache();
clearLndProxyCache();
clearTapdProxyCache();
return Promise.resolve({ success: true });
};

Expand Down
6 changes: 3 additions & 3 deletions electron/lnd/lndProxyServer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IpcMain } from 'electron';
import { debug } from 'electron-log';
import createLndRpc, * as LND from '@radar/lnrpc';
import { DefaultsKey, ipcChannels, withDefaults } from '../../src/shared';
import { ipcChannels, LndDefaultsKey, withLndDefaults } from '../../src/shared';
import { LndNode } from '../../src/shared/types';

/**
Expand Down Expand Up @@ -169,7 +169,7 @@ export const initLndProxy = (ipc: IpcMain) => {
`LndProxyServer: send response "${uniqueChan}"`,
JSON.stringify(result, null, 2),
);
result = withDefaults(result, channel as DefaultsKey);
result = withLndDefaults(result, channel as LndDefaultsKey);
// response to the calling process with a reply
event.reply(uniqueChan, result);
} catch (err: any) {
Expand All @@ -184,6 +184,6 @@ export const initLndProxy = (ipc: IpcMain) => {
/**
* Clears the cached rpc instances
*/
export const clearProxyCache = () => {
export const clearLndProxyCache = () => {
rpcCache = {};
};
Loading