From 3491448a906174138cc09fbdbbf9b28756a530d0 Mon Sep 17 00:00:00 2001 From: Overbool Date: Fri, 7 Sep 2018 21:56:23 +0800 Subject: [PATCH] modify Addresses.Gateway/API to array License: MIT Signed-off-by: Overbool --- addresses.go | 4 ++-- init.go | 4 ++-- profile.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addresses.go b/addresses.go index 22c5306..23095e5 100644 --- a/addresses.go +++ b/addresses.go @@ -5,6 +5,6 @@ type Addresses struct { Swarm []string // addresses for the swarm to listen on Announce []string // swarm addresses to announce to the network NoAnnounce []string // swarm addresses not to announce to the network - API string // address for the local API (RPC) - Gateway string // address to listen on for IPFS HTTP object gateway + API []string // address for the local API (RPC) + Gateway []string // address to listen on for IPFS HTTP object gateway } diff --git a/init.go b/init.go index c4ea9e4..4f1af02 100644 --- a/init.go +++ b/init.go @@ -105,8 +105,8 @@ func addressesConfig() Addresses { }, Announce: []string{}, NoAnnounce: []string{}, - API: "/ip4/127.0.0.1/tcp/5001", - Gateway: "/ip4/127.0.0.1/tcp/8080", + API: []string{"/ip4/127.0.0.1/tcp/5001"}, + Gateway: []string{"/ip4/127.0.0.1/tcp/8080"}, } } diff --git a/profile.go b/profile.go index d3f1b42..bd2e778 100644 --- a/profile.go +++ b/profile.go @@ -66,8 +66,8 @@ profile, enables discovery in local networks.`, is useful when using the daemon in test environments.`, Transform: func(c *Config) error { - c.Addresses.API = "/ip4/127.0.0.1/tcp/0" - c.Addresses.Gateway = "/ip4/127.0.0.1/tcp/0" + c.Addresses.API = []string{"/ip4/127.0.0.1/tcp/0"} + c.Addresses.Gateway = []string{"/ip4/127.0.0.1/tcp/0"} c.Addresses.Swarm = []string{ "/ip4/127.0.0.1/tcp/0", }